package cn.com.api.mapper.base;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiU_favorite;

//DAO
public interface U_favoriteMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_FAVORITE  WHERE ID = #{ID}")
	public ApiU_favorite findU_favoriteById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM U_favorite")
	public List<ApiU_favorite> findU_favorites();

	// 添加
	@Insert("INSERT INTO U_FAVORITE (CONN_ID, TYPE, USER_ID, ADD_TIME) VALUES (#{conn_id}, #{type}, #{user_id}, #{add_time})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertU_favorite(ApiU_favorite u_favorite);

	// 修改
	@Update("UPDATE U_FAVORITE SET conn_id = #{conn_id}, type = #{type}, user_id = #{user_id}, add_time = #{add_time} WHERE ID = #{id}")
	public int updateU_favorite(ApiU_favorite u_favorite);

	// 删除
	@Delete("DELETE FROM U_FAVORITE  WHERE ID = #{ID}")
	public int deleteU_favorite(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
